package com.woniu.controller;


import cn.dev33.satoken.stp.StpUtil;
import com.woniu.entity.vo.MenuVo;
import com.woniu.service.MenuService;
import com.woniu.utils.ResultObj;
import jakarta.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/menu")
@CrossOrigin
public class MenuController {
    @Autowired
    private MenuService menuService;
    @GetMapping("/selectMenuByUserName")
    public ResultObj selectMenuByUserName(String userName) {
        List<MenuVo> menus = menuService.selectMenuByUserName(userName);
        return ResultObj.ok(menus);
    }

}
